//
//  ShellAccountTextField.m
//  ShellWallert
//
//  Created by lvzhao on 2019/10/1.
//  Copyright © 2019 VV. All rights reserved.
//

#import "ShellAccountTextField.h"

@implementation ShellAccountTextField

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        self.bColor = UIColorHex(0x11385E);
        self.bWidth = 1;
        self.textColor = UIColorHex(0xFFFFFF);
        self.font = k_textFont(15);

        UIView *leftView = [UIView new];
        leftView.frame = CGRectMake(0, 0, 15, 50);
        self.leftView = leftView;
        //设置显示模式为永远显示(默认不显示)
        self.leftViewMode = UITextFieldViewModeAlways;
        self.cornerRadius = 6;
        
        [self setAutocorrectionType:UITextAutocorrectionTypeNo];


    }
    return self;
}

- (void)setPlaceholder:(NSString *)placeholder{
    [super setPlaceholder:placeholder];
    self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName: UIColorHex(0x678DA8)}];
}

- (CGRect)rightViewRectForBounds:(CGRect)bounds {
    CGRect rightRect = [super rightViewRectForBounds:bounds];
    rightRect.origin.x -= 20; //左边偏10
    return rightRect;
}

@end
